<!--Display Schedule Name-->
<h1>Schedule -- <?php echo $schedule_detail["schedule_name"]; ?></h1>
<hr/><br/>
<h2>Activities under this schedule:</h2>
<!--Display list of activities in the schedule-->
<table>
    <tr>
        <th>Activity Name</th>
        <th>Start Date</th>
        <th>Actual Start Date</th>
        <th>End Date</th>
        <th>Actual End Date</th>
        <th>Description</th>
        <th>Edit</th>
        <th>Delete</th>
    </tr>
    <?php
    foreach ($schedule_detail["activities"] as $row) {
        ?>
        <tr>
            <td><?php echo $row->activity_title; ?></td>
            <td><?php echo $row->start_date; ?></td>
            <td><?php echo $row->actual_start_date; ?></td>
            <td><?php echo $row->end_date; ?></td>
            <td><?php echo $row->actual_end_date; ?></td>
            <td><?php echo $row->description; ?></td>
            <td><?php echo anchor('schedule/update_activity/' . $row->student_activity_id, 'Edit'); ?></td>
            <td><?php echo anchor('schedule/delete_activity/' . $row->student_activity_id, 'Delete'); ?></td>
        </tr>
        <?php
    }
    ?>
</table>
<?php
echo nbs(3);
?>

<hr/><br/>
<h2>Create New Activity:</h2>
<?php
if ($schedule_detail["sync_gcalendar"] == 1) {
    echo "<p>Note: Activity created under this schedule will be auto-synced to your Google Calendar!</p><br/>";
}
?>

<div class="imageborder1" style="width:290px ;height:320px; float: left">
    <div style="margin: 10px; ">
        <h2>Create Own activity</h2>
        <br/>
        <?php
        echo form_open('schedule/create_activity', '', array('schedule_id' => $schedule_id, 'country_id' => $country_id, 'sync_gcalendar' => $schedule_detail["sync_gcalendar"]));

        echo form_label('Activity Name:', 'name', array('class' => 'left_col1'));
        echo form_input(array('name' => 'name', 'id' => 'name', 'class' => 'left_col2'));
        echo nbs(3);
        echo '<span id="name_msg"></span>';
        echo br(1);
        echo '<div id="clear"></div>';

        echo form_label('Start Date:', 'date1', array('class' => 'left_col1'));
        echo form_input(array('name' => 'date1', 'id' => 'date1', 'class' => 'date-pick'));
        echo nbs(3);
        echo '<span id="date1_msg"></span>';
        echo br(1);
        echo '<div id="clear"></div>';

        echo form_label('End Date:', 'date2', array('class' => 'left_col1'));
        echo form_input(array('name' => 'date2', 'id' => 'date2', 'class' => 'date-pick'));
        echo nbs(3);
        echo '<span id="date2_msg"></span>';
        echo br(1);
        echo '<div id="clear"></div>';

        echo form_label('Description:', 'description', array('class' => 'left_col1'));
        echo form_textarea(array('name' => 'description', 'id' => 'description', 'rows' => '5', 'cols' => '30', 'class' => 'left_col2'));
        echo nbs(3);
        echo '<span id="description_msg"></span>';
        echo br(1);
        echo '<div id="clear"></div>';

        echo form_submit(array('name' => 'submit', 'id' => 'activity'), 'Add into Schedule');

        echo form_close();
        ?>
    </div>            
</div>

<div class="imageborder1" style="width:290px; height:320px; float: left; margin-left: 60px;">
    <div style="margin: 10px; ">
        <h2>Standard Activities</h2>
        <br/>
        <marquee behavior="scroll" direction="down" height="290px" scrollamount ="1.5">
            <?php
            if (count($standard_activity) != 0) {
                foreach ($standard_activity as $row) {
                    $hidden = array(
                        'country_id' => $country_id,
                        'schedule_id' => $schedule_id,
                        'activity_title' => $row->activity_title,
                        'description' => $row->description,
                        'duration' => $row->duration,
                    );
                    echo form_open('schedule/view_standard_activity', '', $hidden);
                    echo $row->activity_title;
                    echo br(1);
                    echo $row->description;
                    echo br(1);
                    echo $row->duration;
                    echo br(1);
                    echo form_submit('submit', 'Details>>');
                    echo form_close();
                    echo "<hr/>";
                }
            }
            ?>
        </marquee>
    </div>
</div>
